package cn.getech.data.development.mapper;

import cn.getech.data.development.entity.JobNodeRunHistory;
import cn.getech.data.development.model.dto.LogAndIdDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 任务节点执行历史表 Mapper 接口
 * </p>
 *
 * @author zenith
 * @since 2018-08-27
 */
@Mapper
public interface JobNodeRunHistoryMapper extends BaseMapper<JobNodeRunHistory> {

    /**
     * @Description 根据jobNodeId查询jobNode的运行日志记录数据
     * @Author  hujz
     * @Date   2019/8/19 11:41
     * @Param
     * @Return
     * @Exception
     *
     */
    List<JobNodeRunHistory> selctListByNodeIdLimit(@Param("limitSize") Integer limitSize
            , @Param("jobInfoId") Integer jobInfoId
            , @Param("nodeKey") String nodeKey
            , @Param("jobNodeInfoId") Integer jobNodeInfoId);

    void batchUpdateStatus(@Param("jobNodeRunHistories") List<JobNodeRunHistory> jobNodeRunHistories);

    void batchUpdateKillStatus(@Param("jobNodeRunHistories") List<JobNodeRunHistory> jobNodeRunHistories);

    void removeLogicBatch(@Param("ozJobIds") List<String> ozJobIds);

    List<LogAndIdDto> limitListsByJobId(@Param("jobId") Integer jobId);

    List<String> listByOozieId(@Param("lastOozieJobId")String lastOozieJobId);

    List<LogAndIdDto> limitListsByOOzieIds(@Param("oozieIds") List<String> oozieIds);
}
